let http = (obj)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			// #ifdef H5
			url:'/api' + obj.url,
			// #endif
			// #ifdef MP-WEIXIN
			url:'http://localhost:3000' + obj.url,
			// #endif
			method:obj.method || 'GET',
			data:obj.data || {},
			header:obj.header || {'Content-type':'application/json'},
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}

export default http;